<?php

/**
 * @author      :   KIETTHM
 * @name        :   IndexController
 * @copyright   :   Fpt Online
 * @todo        :   Index Controller
 */
class Euro2012_IndexController extends Zend_Controller_Action
{

    /**
     * init of controller
     */
    public function init()
    {
        //Disable layout       
       //$this->_helper->layout->setLayout('common');

    }

    //index action
    public function indexAction()
    {
        $this->_helper->viewRenderer->setNoRender();

        //Assign metadata
        $this->view->headTitle()->prepend(META_TITLE);
        $this->view->headMeta()->prependName('keywords',META_KEYWORDS);
        $this->view->headMeta()->prependName('description',META_DESC);
    }
    public function statusloginAction(){
        $this->_helper->layout()->disableLayout();
        $this->_helper->viewRenderer->setNoRender();

        $result = array(
            'userid' => 0,
            'topbar'=>'',
            'comment'=>''
        );

        //check status login
        if(isset($this->view->userid) && $this->view->userid > 0){
            $result['userid'] = $this->view->userid;
        }

        $this->view->assign('urlRedirect', $this->getRequest()->getParam('urlredirect', ''));

        $result['topbar'] = trim($this->view->render('/index/statuslogin.phtml'));
        $result['comment'] = trim($this->view->render('/index/statuslogincmt.phtml'));

        echo Zend_Json::encode($result);
    }
}

?>